<?php 
session_start();
if($_SESSION['temp'] == ''){
if(($fp = fopen('counter.dat','r')) == false){
echo "打开文件失败";
}else{
$counter = fgets($fp,1024);
$counter++;
$fp = fopen("counter.dat",'w');
fputs($fp,$counter);
fclose($fp);
echo $counter;
}
$_SESSION['temp'] = 1;
}else{
$fp = fopen('counter.dat','r');
$counter = fgets($fp,1024);
echo $counter;
}
?>
 
总访问 <span style="font-size:14px; color:#FF6600" mce_style="font-size:14px; color:#FF6600"><?php echo $counter;?></span> 次